package types

type NotifyType int

const (
	NotifyTypeBotApproved NotifyType = iota
	NotifyTypeBotRejected
	NotifyTypeBotUpdated
	NotifyTypeBotStatusChanged
	NotifyTypeBotDeleted
	NotifyTypeBotAdded
	NotifyTypeBotUpAdded
	NotifyTypeBotUpRemoved
	ServerAdded
	ServerRemoved
	ServerUpdated
	ServerUpAdded
	ServerUpRemoved
	PremiumPurchased
	PremiumExpired
	CommentAdded
	CommentRemoved
	CommentUpdated
	CommentLiked
	ReportAdded
	ReportRejected
	ReportApproved
)

type WebhookSettings struct {
	Enabled bool              `json:"enabled"`
	Headers map[string]string `json:"headers"`
	URL     string            `json:"url"`
}

type Notify struct {
	Type            string           `json:"type"`
	Payload         any              `json:"payload,omitempty"`
	Affected        string           `json:"id"`
	User            string           `json:"user"`
	Happened        int64            `json:"happened"`
	WebhookSettings *WebhookSettings `json:"webhookSettings,omitempty"`
}
